﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Profile;

namespace Agility.Web.Services
{
    public class ProfileWrapper : IProfileWrapper
    {
        ProfileBase profile;

        public IProfileWrapper Create(string userName, bool isAuthenticated)
        {
            this.profile = ProfileBase.Create(userName, isAuthenticated);
            return this;
        }

        public void SetPropertyValue(string propertyName, string propertyValue)
        {
            profile.SetPropertyValue(propertyName, propertyValue);
        }

        public void Save()
        {
            profile.Save();
        }
    }

    public interface IProfileWrapper
    {
        IProfileWrapper Create(string userName, bool isAuthenticated);
        void SetPropertyValue(string propertyName, string propertyValue);
        void Save();
    }
}